<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_变量与常量</title>
</head>
<body>
<script>
    //JS通过var关键字声明变量
    //JS是一门弱类型的语言
    var a = 1;
    console.log(a);
    var b = 3.14;
    console.log(b);
    var c = "hello world";
    console.log(c);
    var d = true;
    console.log(d);
    var a = "我又来了！！";
    console.log(a);
    a = 100 ;
    console.log(a);

    //使用let关键字声明变量
    let x = 1;
    console.log(x);
    x = 2;
    console.log(x);
    // let x = 3.14;
    // console.log(x); //报错let声明的变量不可以重复声明

    //使用const关键字声明常量
    const y = 1;
    console.log(y);
    //y = 3; //常量的值不允许被修改
</script>
</body>
</html>